<?php

global $_W, $_GPC;

$commissionModel = p('commission');

$openid = $_W['openid'];

$allMembers = $commissionModel->getAllNextMembers($openid)->getMembers();
$base = $commissionModel->getAllNextMembers($openid, true);

$detail = $base->getAllSalesvolumes()->getAllWealths()->getDetail();
$sales = $detail->afterSales;
$wealths = $detail->wealthsPrice;
$member  = $base->member;

if(!empty($member['agentid'])){
    $superior = m('member')->getMember($member['agentid']);
}

$member['commission'] = $commissionModel->getLevel($base->member['openid']);

if(empty($member['commission'])){
    $set = m('common')->getSysset('shop');
    $member['commission']['levelname'] = $set['levelname'];
}

include $this->template('member/centerx');